package com.yang.trainingCamp.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yang.trainingCamp.pojo.CamperProducts;
import com.yang.trainingCamp.pojo.Campers;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CamperProductsMapper extends BaseMapper<CamperProducts> {

    @Update("update camper_products set `number` = `number`-1 where id in (select camper_product_id from entry_record where in_camp = 1 and entry_time <= now())")
    void updateCamperProductNumber();
}
